home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / xview / genial / ui / zoom.c < prev   
Encoding:
C/C++ Source or Header  |  1992-07-14  |  1.5 KB  |  75 lines

  1. /*
  2.  * zoom.c
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <sys/param.h>
  7. #include <sys/types.h>
  8. #include <xview/xview.h>
  9. #include <xview/panel.h>
  10. #include <xview/textsw.h>
  11. #include <xview/xv_xrect.h>
  12. #include "display.h"
  13. #include "ui.h"
  14. #include "reg.h"
  15. #include "zoom_ui.h"
  16. #include "zoom.h"
  17.  
  18. extern void       zoom_resize_proc();
  19.  
  20. static Cursor lcurs = NULL, rcurs, ucurs, dcurs;    /* cursors in left,
  21.                              * right, up and down
  22.                              * directions */
  23. setcursor(win, dir)
  24.     Xv_Window win;
  25.     int       dir;
  26. {
  27.     XID       xid = (XID) xv_get(win, XV_XID);
  28.  
  29.     switch (dir) {
  30.     case LEFT:
  31.     XDefineCursor(display, xid, lcurs);
  32.     break;
  33.     case RIGHT:
  34.     XDefineCursor(display, xid, rcurs);
  35.     break;
  36.     case UP:
  37.     XDefineCursor(display, xid, ucurs);
  38.     break;
  39.     case DOWN:
  40.     XDefineCursor(display, xid, dcurs);
  41.     break;
  42.     }
  43. }
  44.  
  45. /* routine to make our cursors */
  46. zoom_mk_cursors()
  47. {
  48.     lcurs = XCreateFontCursor(display, XC_left_side);
  49.     rcurs = XCreateFontCursor(display, XC_right_side);
  50.     ucurs = XCreateFontCursor(display, XC_top_side);
  51.     dcurs = XCreateFontCursor(display, XC_bottom_side);
  52. }
  53.  
  54. /*
  55.  * Event callback function for `zmwin'.
  56.  */
  57. Notify_value
  58. zoom_zmwin_event_callback(win, event, arg, type)
  59.     Xv_window win;
  60.     Event    *event;
  61.     Notify_arg arg;
  62.     Notify_event_type type;
  63. {
  64. #ifdef DEBUG
  65.     fprintf(stderr, "zoom: zoom_zmwin_event_callback: event %d\n",
  66.         event_id(event));
  67. #endif
  68.  
  69.     if (event_action(event) == WIN_RESIZE) {
  70.     zoom_resize_proc(win, event, arg, type);
  71.     }
  72.  
  73.     return notify_next_event_func(win, (Notify_event) event, arg, type);
  74. }
  75.